import HomeView from '@/views/HomeView.vue'
import { createRouter, createWebHistory } from 'vue-router'

export const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: HomeView,
    },
    {
      path: '/login',
      name: 'Login',
      component: () => import('../views/Login.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/register',
      name: 'Register',
      component: () => import('../views/Register.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/user',
      name: 'user',
      component: () => import('../views/UserProfile.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/order',
      name: 'order',
      component: () => import('../views/OrderCreate.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/order-list',
      name: 'order_list',
      component: () => import('../views/OrderList.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/OrderDetail',
      name: 'OrderDetail',
      component: () => import('../views/OrderDetail.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/tasks',
      name: 'tasks',
      component: () => import('../views/TaskBoard.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/taskDetail',
      name: 'taskDetail',
      component: () => import('../views/Tasks.Detail.vue'),
      meta: { requiresGuest: true },
    },
    {
      path: '/pays',
      name: 'pays',
      component: () => import('../views/PaymentPage.vue'),
      meta: { requiresGuest: true },
    },
  ],
})
